package csc.fresher.spring.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping(value = "/login")
public class LoginController {

	@RequestMapping
	public String goLogin(Model model, @RequestParam(value = "loginfail", required = false) String loginfail){
		if(loginfail != null){
			model.addAttribute("loginfail", "Invalid username or password");
		}
		return "login";
	}
}
